home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus Special 23
/
AMIGAplus Sonderheft 23 (2000)(Falke)(DE)[!].iso
/
Tools
/
Packer
/
xad
/
Developer
/
Include
/
C
/
libraries
/
xadmaster.h
Wrap
C/C++ Source or Header
|
1999-11-06
|
20KB
|
463 lines
#ifndef LIBRARIES_XADMASTER_H
#define LIBRARIES_XADMASTER_H
/*
** $VER: xadmaster.h 1.1 (11.11.1998)
** xadmaster.library defines and structures
**
** Copyright © 1998 by Dirk Stöcker
** All Rights Reserved.
*/
#ifndef EXEC_LIBRARIES_H
#include <exec/libraries.h>
#endif
#ifndef UTILITY_TAGITEM_H
#include <utility/tagitem.h>
#endif
/************************************************************************
* *
* library base structure *
* *
************************************************************************/
struct xadMasterBase {
struct Library xmb_LibNode;
struct ExecBase * xmb_SysBase;
struct DosLibrary * xmb_DOSBase;
struct UtilityBase * xmb_UtilityBase;
ULONG xmb_RecogSize; /* read only */
};
/************************************************************************
* *
* tag-function call flags *
* *
************************************************************************/
/* input tags for xadGetInfo, only one can be specified per call */
#define XAD_INSIZE (TAG_USER+ 1) /* input data size */
#define XAD_INFILENAME (TAG_USER+ 2)
#define XAD_INFILEHANDLE (TAG_USER+ 3)
#define XAD_INMEMORY (TAG_USER+ 4)
#define XAD_INHOOK (TAG_USER+ 5)
/* output tags, only one can be specified per call, xadXXXXUnArc */
#define XAD_OUTSIZE (TAG_USER+ 10) /* output data size */
#define XAD_OUTFILENAME (TAG_USER+ 11)
#define XAD_OUTFILEHANDLE (TAG_USER+ 12)
#define XAD_OUTMEMORY (TAG_USER+ 13)
#define XAD_OUTHOOK (TAG_USER+ 14)
#define XAD_OUTDEVICE (TAG_USER+ 15) /* for disk archives only */
/* object allocation tags for xadAllocObjectA */
#define XAD_OBJNAMESIZE (TAG_USER+ 20) /* XADOBJ_FILEINFO, size of needed name space */
#define XAD_OBJCOMMENTSIZE (TAG_USER+ 21) /* XADOBJ_FILEINFO, size of needed comment space */
#define XAD_OBJPRIVINFOSIZE (TAG_USER+ 22) /* XADOBJ_FILEINFO & XADOBJ_DISKINOF, self use size */
#define XAD_OBJBLOCKENTRIES (TAG_USER+ 23) /* XADOBJ_DISKINFO, number of needed entries */
/* tags for xadGetInfo, xadFileUnArc and xadDiskUnArc */
#define XAD_NOEXTERN (TAG_USER+ 50) /* do not use extern clients */
#define XAD_PASSWORD (TAG_USER+ 51) /* password when needed */
#define XAD_ENTRYNUMBER (TAG_USER+ 52) /* number of wanted entry */
#define XAD_PROGRESSHOOK (TAG_USER+ 53) /* the progress hook */
#define XAD_OVERWRITE (TAG_USER+ 54) /* overwrite file ? */
#define XAD_MAKEDIRECTORY (TAG_USER+ 55) /* create directory tree */
#define XAD_IGNOREGEOMETRY (TAG_USER+ 56) /* ignore drive geometry ? */
#define XAD_LOWCYLINDER (TAG_USER+ 57) /* lowest cylinder */
#define XAD_HIGHCYLINDER (TAG_USER+ 58) /* highest cylinder */
/* input tags for xadConvertDates, only one can be passed */
#define XAD_DATEUNIXUTC (TAG_USER+ 70) /* unix date variable */
#define XAD_DATEAMIGA (TAG_USER+ 71) /* amiga date variable */
#define XAD_DATEDATESTAMP (TAG_USER+ 72) /* struct DateStamp */
#define XAD_DATEXADDATE (TAG_USER+ 73) /* struct xadDate */
#define XAD_DATECLOCKDATA (TAG_USER+ 74) /* struct ClockData */
#define XAD_DATECURRENTTIME (TAG_USER+ 75) /* input is system time */
/* output tags, there can be specified multiple tags for one call */
#define XAD_GETDATEUNIXUTC (TAG_USER+ 80) /* unix date variable */
#define XAD_GETDATEAMIGA (TAG_USER+ 81) /* amiga date variable */
#define XAD_GETDATEDATESTAMP (TAG_USER+ 82) /* struct DateStamp */
#define XAD_GETDATEXADDATE (TAG_USER+ 83) /* struct xadDate */
#define XAD_GETDATECLOCKDATA (TAG_USER+ 84) /* struct ClockData */
/************************************************************************
* *
* objects for xadAllocObjectA *
* *
************************************************************************/
#define XADOBJ_ARCHIVEINFO 0x0001 /* struct xadArchiveInfo */
#define XADOBJ_FILEINFO 0x0002 /* struct xadFileInfo */
#define XADOBJ_DISKINFO 0x0003 /* struct xadDiskInfo */
#define XADOBJ_HOOKPARAM 0x0004 /* struct HookParam */
#define XADOBJ_DEVICEINFO 0x0005 /* struct xadDeviceInfo */
#define XADOBJ_PROGRESSINFO 0x0006 /* struct xadProgressInfo */
/************************************************************************
* *
* hook related stuff *
* *
************************************************************************/
#define XADHC_READ 1 /* read data into buffer */
#define XADHC_WRITE 2 /* write buffer data to file/memory */
#define XADHC_SEEK 3 /* seek in file */
#define XADHC_INIT 4 /* initialize the hook */
#define XADHC_FREE 5 /* end up hook work, free stuff */
#define XADHC_ABORT 6 /* an error occured, delete partial stuff */
#define XADHC_FULLSIZE 7 /* complete input size is needed */
struct xadHookParam {
ULONG xhp_Command;
ULONG xhp_CommandData;
APTR xhp_BufferPtr;
LONG xhp_BufferSize;
LONG xhp_DataPos; /* current seek position */
APTR xhp_PrivatePtr;
};
/* xadHookAccess commands */
#define XADAC_READ 10 /* get data */
#define XADAC_WRITE 11 /* write data */
#define XADAC_COPY 12 /* copy input to ouput */
#define XADAC_INPUTSEEK 13 /* seek in input file */
#define XADAC_OUTPUTSEEK 14 /* seek in output file */
/************************************************************************
* *
* support structures *
* *
************************************************************************/
/* Own date structure to cover all possible dates in a human friendly
format. xadConvertDates may be used to convert between different date
structures and variables. */
struct xadDate {
ULONG xd_Micros; /* values 0 to 999999 */
LONG xd_Year; /* values 1 to 2147483648 */
UBYTE xd_Month; /* values 1 to 12 */
UBYTE xd_WeekDay; /* values 1 to 7 */
UBYTE xd_Day; /* values 1 to 31 */
UBYTE xd_Hour; /* values 0 to 23 */
UBYTE xd_Minute; /* values 0 to 60 */
UBYTE xd_Second; /* values 0 to 60 */
};
#define XADDAY_MONDAY 1 /* monday is the first day and */
#define XADDAY_TUESDAY 2
#define XADDAY_WEDNESDAY 3
#define XADDAY_THURSDAY 4
#define XADDAY_FRIDAY 5
#define XADDAY_SATURDAY 6
#define XADDAY_SUNDAY 7 /* sunday the last day of a week */
struct xadDeviceInfo { /* for XAD_OUTDEVICE tag */
STRPTR xdi_DeviceName; /* name of device */
ULONG xdi_Unit; /* unit of device */
STRPTR xdi_DOSName; /* instead of Device+Unit, dos name without ':' */
};
/************************************************************************
* *
* information structures *
* *
************************************************************************/
struct xadArchiveInfo {
struct xadClient * xai_Client; /* pointer to unarchiving client */
APTR xai_PrivateClient; /* private client data */
STRPTR xai_Password; /* password for crypted archives */
ULONG xai_Flags; /* read only XADAIF_ flags */
ULONG xai_LowCyl; /* lowest cylinder to unarchive */
ULONG xai_HighCyl; /* highest cylinder to unarchive */
ULONG xai_InPos; /* input position, read only */
ULONG xai_InSize; /* input size, read only */
ULONG xai_OutPos; /* output position, read only */
ULONG xai_OutSize; /* output file size, read only */
struct xadFileInfo * xai_FileInfo; /* data pointer for file arcs */
struct xadDiskInfo * xai_DiskInfo; /* data pointer for disk arcs */
struct xadFileInfo * xai_CurFile; /* data pointer for current file arc */
struct xadDiskInfo * xai_CurDisk; /* data pointer for current disk arc */
};
/* This structure is nearly complete private to either xadmaster or its
clients. An application program may access for reading only xai_Client,
xai_Flags, xai_FileInfo and xai_DiskInfo. For xai_Flags only XADAIF_CRYPTED
is useful. All the other stuff is private and should not be accessed! */
#define XADAIB_CRYPTED 0 /* archive entries are encrypted */
#define XADAIB_FILECORRUPT